---@class HeroBigIcon : GComponent
local HeroBigIcon = fgui.extension("ui://AtlasHero/Com_HeroBigIcon",GComponent)
function HeroBigIcon:ctor()
    self.heroIcon = self:GetChild("icon")
    self.type = self:GetChild("type")
    self.textCost = self:GetChild("text_cost")
    ---@type GController
    self.ctrlEmpty = self:GetController("empty")
end
function HeroBigIcon:Dispose()
    self.heroIcon = nil
    self.type = nil
    self.textCost = nil
    self.ctrlEmpty = nil
end
function HeroBigIcon:SetHeroId(id)
    self.heroId = id
    if id == nil then return end
    self.ctrlEmpty.selectedIndex = 1
    local cfg = DataTable.GetById("t_hero",self.heroId)
    self.heroIcon.url = IconUtil.GetHeroCardIconUrl(self.heroId)
    self.textCost.text = tostring(cfg.f_ConsumeEnergy)
end
---序列下标
function HeroBigIcon:SetIndex(index)
    self.index = index
end
function HeroBigIcon:IsEmpty()
    return self.ctrlEmpty.selectedIndex == 0
end
function HeroBigIcon:SetEmpty()
    self.heroId = 0
    self.ctrlEmpty.selectedIndex = 0
end
function HeroBigIcon:Refresh()

end
function HeroBigIcon:RegisterOnClick(callback,tb)
    self.clickCallback = callback
    self.clickCallbackTB = tb
    self.onClick:Add(self.ClickItem,self)
end
function HeroBigIcon:ClickItem()
    if self.clickCallback then
        self.clickCallback(self.clickCallbackTB,self)
    end
end
return HeroBigIcon